﻿using System.Windows;
using System.Windows.Controls;
using LiveTiss.Schemas;

namespace LiveTiss.Guias.UserControls
{
    public partial class OPMSolicitadasOPMSolicitada : UserControl
    {
        #region Value

        public ct_OPMSolicitadasOPMSolicitada Value
        {
            get { return (ct_OPMSolicitadasOPMSolicitada)GetValue(ValueProperty); }
            set { SetValue(ValueProperty, value); }
        }

        public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value", 
            typeof(ct_OPMSolicitadasOPMSolicitada), typeof(OPMSolicitadasOPMSolicitada), new PropertyMetadata(null));

        #endregion

        public OPMSolicitadasOPMSolicitada()
        {
            this.DataContext = this;

            if (this.Value == null)
            {
                this.Value = new ct_OPMSolicitadasOPMSolicitada()
                {
                    fabricante = string.Empty,
                    OPM = new ct_tabela()
                    {
                        codigo = string.Empty,
                        descricao = string.Empty,
                        tipoTabela = st_tabela.Item00
                    },
                    quantidadeSolicitada = 0,
                    valor = 0,
                    valorSpecified = true
                };
            }

            InitializeComponent();
        }
    }
}
